<template>
  <div>
    <div class="step-container">
      <div class="list-item">
        <div class="img-box active">
          <img src="@/assets/taskStatus/prepare-model.png" alt="">
        </div>
        <span class="step-text">待飞行</span>
      </div>
      <div class="arrow arrow-active">>></div>
      <div class="list-item">
        <div class="img-box" :class="{'active':data.status === 6 || data.status === 10 || data.status === 7 || data.status === 15 }">
          <img src="@/assets/taskStatus/lixiangzhunbei.png" alt="">
        </div>
        <span class="step-text">准备中</span>
      </div>
      <div class="arrow" :class="{'arrow-active':data.status === 6 || data.status === 10 || data.status === 7 || data.status === 15 }">>></div>
      <div class="list-item">
        <div class="img-box" :class="{'active':data.status === 10 || data.status === 7 || data.status === 15 }">
          <img src="@/assets/taskStatus/feihang.png" alt="">
        </div>
        <span class="step-text">飞行中</span>
      </div>
      <div class="arrow" :class="{'arrow-active':data.status === 10 || data.status === 7 || data.status === 15 }">>></div>
      <div v-if="data.status !== 7" class="list-item">
        <div class="img-box" :class="{'active':data.status === 15 }">
          <img src="@/assets/taskStatus/wancheng.png" alt="">
        </div>
        <span class="step-text">飞行完成</span>
      </div>
      <div v-else class="list-item">
        <div class="img-box" :class="{'fail-active':data.status === 7 }">
          <img src="@/assets/taskStatus/gantanhao.png" alt="">
        </div>
        <span class="step-text">任务失败</span>
      </div>
    </div>
  </div>
</template>
<script setup name="TaskStatus">
defineProps({
  data: {
    type: Object,
    default: () => null
  }
})
</script>
<style scoped lang='scss'>
.step-container{
  display: flex;
  .list-item{
    width: 60px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: center;
    .img-box{
      width: 42px;
      height: 40px;
      line-height: 40px;
      border-radius: 12px;
      margin-left: 14px;
      text-align: center;
      vertical-align: middle;
      border: 1px solid #FFFFFF;
      // background-color: #333;
      img{
        width: 25px;
        height: 25px;
        vertical-align: middle;
      }
    }
    .step-text{
      display: inline-block;
      margin-left: 5px;
      margin-top: 5px;
      width: 60px;
      color: #FFF;
    }
  }
  .arrow{
    margin: 0 10px;
    line-height: 40px;
    font-weight: 700;
  }
  .active{
    background-color: #3B6BEC !important;
    border: 1px solid #3B6BEC !important;
  }
  .arrow-active{
    color: #3B6BEC !important;
  }
  .fail-active{
    background-color: #EF6A62 !important;
    border: 1px solid #EF6A62 !important;
  }
}
</style>
